import Vue from 'vue';
//配置路由
import VueRouter from 'vue-router'
Vue.use(VueRouter);
//1.创建组件
import Index from '@/views/index'
import Home from '@/views/home'
import Login from '@/views/login'
import NotFound from '@/views/404'
import UpdatePassword from '@/views/update-password'
import pay from '@/views/pay'
import register from '@/views/register'
import center from '@/views/center'
    import tuihaiyajin from '@/views/modules/tuihaiyajin/list'
    import chengshixinxi from '@/views/modules/chengshixinxi/list'
    import yonghuhaiche from '@/views/modules/yonghuhaiche/list'
    import dengjishoufei from '@/views/modules/dengjishoufei/list'
    import discussyingyemendian from '@/views/modules/discussyingyemendian/list'
    import discusscheliangxinxi from '@/views/modules/discusscheliangxinxi/list'
    import zulincheliang from '@/views/modules/zulincheliang/list'
    import yonghuquche from '@/views/modules/yonghuquche/list'
    import cheliangxuzu from '@/views/modules/cheliangxuzu/list'
    import yonghu from '@/views/modules/yonghu/list'
    import yonghupingjia from '@/views/modules/yonghupingjia/list'
    import tongzhigonggao from '@/views/modules/tongzhigonggao/list'
    import mendianfuzeren from '@/views/modules/mendianfuzeren/list'
    import yingyemendian from '@/views/modules/yingyemendian/list'
    import cheliangpinpai from '@/views/modules/cheliangpinpai/list'
    import cheliangxinxi from '@/views/modules/cheliangxinxi/list'
    import config from '@/views/modules/config/list'


//2.配置路由   注意：名字
const routes = [{
    path: '/index',
    name: '首页',
    component: Index,
    children: [{
      // 这里不设置值，是把main作为默认页面
      path: '/',
      name: '首页',
      component: Home,
      meta: {icon:'', title:'center'}
    }, {
      path: '/updatePassword',
      name: '修改密码',
      component: UpdatePassword,
      meta: {icon:'', title:'updatePassword'}
    }, {
      path: '/pay',
      name: '支付',
      component: pay,
      meta: {icon:'', title:'pay'}
    }, {
      path: '/center',
      name: '个人信息',
      component: center,
      meta: {icon:'', title:'center'}
    }
      ,{
	path: '/tuihaiyajin',
        name: '退还押金',
        component: tuihaiyajin
      }
      ,{
	path: '/chengshixinxi',
        name: '城市信息',
        component: chengshixinxi
      }
      ,{
	path: '/yonghuhaiche',
        name: '用户还车',
        component: yonghuhaiche
      }
      ,{
	path: '/dengjishoufei',
        name: '登记收费',
        component: dengjishoufei
      }
      ,{
	path: '/discussyingyemendian',
        name: '营业门店评论',
        component: discussyingyemendian
      }
      ,{
	path: '/discusscheliangxinxi',
        name: '车辆信息评论',
        component: discusscheliangxinxi
      }
      ,{
	path: '/zulincheliang',
        name: '租赁车辆',
        component: zulincheliang
      }
      ,{
	path: '/yonghuquche',
        name: '用户取车',
        component: yonghuquche
      }
      ,{
	path: '/cheliangxuzu',
        name: '车辆续租',
        component: cheliangxuzu
      }
      ,{
	path: '/yonghu',
        name: '用户',
        component: yonghu
      }
      ,{
	path: '/yonghupingjia',
        name: '用户评价',
        component: yonghupingjia
      }
      ,{
	path: '/tongzhigonggao',
        name: '通知公告',
        component: tongzhigonggao
      }
      ,{
	path: '/mendianfuzeren',
        name: '门店负责人',
        component: mendianfuzeren
      }
      ,{
	path: '/yingyemendian',
        name: '营业门店',
        component: yingyemendian
      }
      ,{
	path: '/cheliangpinpai',
        name: '车辆品牌',
        component: cheliangpinpai
      }
      ,{
	path: '/cheliangxinxi',
        name: '车辆信息',
        component: cheliangxinxi
      }
      ,{
	path: '/config',
        name: '轮播图管理',
        component: config
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: Login,
    meta: {icon:'', title:'login'}
  },
  {
    path: '/register',
    name: 'register',
    component: register,
    meta: {icon:'', title:'register'}
  },
  {
    path: '/',
    name: '首页',
    redirect: '/index'
  }, /*默认跳转路由*/
  {
    path: '*',
    component: NotFound
  }
]
//3.实例化VueRouter  注意：名字
const router = new VueRouter({
  mode: 'hash',
  /*hash模式改为history*/
  routes // （缩写）相当于 routes: routes
})

export default router;
